package net.zjitc.seqstack;

import java.util.LinkedList;

/**
 * Created by Administrator on 2017/3/23.
 */
public class LinkedStack<E> implements IStack<E>{
    LinkedList<E> list=new LinkedList();
    @Override
    public E push(E item) {
        list.addLast(item);
        return item;
    }

    @Override
    public E pop() {
        return  list.removeLast();
    }

    @Override
    public E peak() {
        return  list.getLast();
    }

    @Override
    public int size() {
        return list.size();
    }

    @Override
    public boolean isEmpty() {
        return isEmpty();
    }
}
